
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<title>登 录</title>
	<link rel="stylesheet" href="__PUBLIC__/mobile/css/public.css">
	<link rel="stylesheet" href="__PUBLIC__/mobile/css/login.css">

	<link href="__PUBLIC__/css/layui.css" rel="stylesheet" type="text/css" media="all"/>
	<script type="text/javascript" src="__PUBLIC__/layui.js"></script>

	<script src="__PUBLIC__/mobile/js/jquery-1.8.3.min.js" type="text/javascript"></script>
	<script src="__PUBLIC__/mobile/js/login.js" type="text/javascript"></script>
	<script src="__PUBLIC__/mobile/js/wxd.js" type="text/javascript"></script>
</head>
<body>
	<header class="nav">
	    <a class="nav-return" href="{:U('mobile/index/index',array('newcity'=>$city))}"></a>
	    <h1 class="nav-title" style="position: absolute;">登录</h1>
	    
	</header>
	
	<section class="main">
	    <div class="logo">
	        <img width="230" height="64" class="logo" src="__PUBLIC__/mobile/images/logo.png">
	    </div>
	    <form class="form layui-form" method="post">
	        <div class="input-wrap">
	            <i class="i-tel"></i>
	            <input required  lay-verify="required" name="phone" autocomplete="off" class="input tel" placeholder="请输入手机号" type="tel" value="{$_COOKIE['shoujname']}">
	            <i class="i-close"></i>
	        </div>
	        <div class="input-wrap p-pwd">
	            <i class="i-pwd"></i>
	            <input required  lay-verify="required" name="password" autocomplete="off" class="input pwd" placeholder="请输入密码" type="password" value="{$_COOKIE['password']}">
	            <i class="i-close"></i>
	        </div>
	        <button class="btn-submit" lay-submit lay-filter="*">登&nbsp;&nbsp;录</button>
	    </form>
	    <p class="protocol" style="border-bottom: 1px solid #f0f0f0;width: 90%;margin-left: 5%;margin-bottom: 10px;padding-bottom: 8px;">
	    	<a href="{:U('mobile/user/repassword',array('newcity'=>$city))}">忘记密码?</a>
	    </p>
	    <p class="protocol">
		    <a href="{:U('mobile/user/jz_zhuce',array('newcity'=>$city))}" style="width: 50%;display: inline-block;float: left;color: #30363a;font-weight: bold;">学员注册</a>
		    <a href="{:U('mobile/user/ls_zhuce',array('newcity'=>$city))}" style="width: 50%;display: inline-block;float: right;color: #30363a;font-weight: bold;">教师注册</a>
	    </p>
	</section>
</body>

<style>
.protocol {
    height: 30px;
    line-height: 30px;
}
</style>
<script type="text/javascript">
    layui.use(['form'], function(){
      var layer = layui.layer
      ,form = layui.form();
      //layer.msg('Hello World');

    form.on('submit(*)', function(data){
        $.ajax({
            url: "{:U('mobile/user/login')}",//请求地址
            type: "post",//请求方式
            dataType: "json",//返回数据类型
            data: data.field,//发送的参数
            })
            .done(function(response) {
                  if(response.error==0){
                     layer.msg(response.info ,{icon:5});

                  }else{
                     layer.msg(response.info ,{icon:6});
                     location.href = response.url;
                  }
              })
            .fail(function() {
                alert("ajxs交互失败");
            })  

          return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });  



    });
</script>
</html>